package page;

import java.util.List;

public  class PaginationImpl implements Pagination{
	private int pageSize;//页行数
	private int pageNumber;//当前页号
	private int maxPages;//最大页号
	private int maxRows;//总行数
	private List data;//当前页数据列表
	
	@Override
	public int getPageSize() {
		return pageSize;
	}
	@Override
	public int getPageNumber() {
		return pageNumber;
	}
	@Override
	public int getMaxPages() {
		int n=maxRows/pageSize;
		if(maxRows==0|| maxRows%pageSize!=0)
			n++;
		return n;
	}
	@Override
	public int getMaxRows() {
		return maxRows;
	}
	@Override
	public List getData() {
		return this.data;
	}
	
	@Override
	public void setData(List data) {
		 this.data=data;
	}
	@Override
	public void setPageSize(int pageSize) {
		this.pageSize=pageSize;
		
	}
	@Override
	public void setPageNumber(int pageNumber) {
		this.pageNumber=pageNumber;
	}
	@Override
	public void setMaxRows(int n) {
		this.maxRows=n;
	}
	
}
